package yerr

func NotNull(vals ...interface{}) error {
	var last interface{}
	for _, val := range vals {
		if val == nil && last == nil {
			// first nil
			return ErrBizTypeNotMatch.Errorf("[first] value {%T} is nil", val)
		} else if val == nil && last != nil {
			// second nil
			return ErrBizTypeNotMatch.Errorf("[after {%T}] value {%T} is nil", last, val)
		}
		last = val
	}
	return nil
}
